from flask import Blueprint
from flask_restful import Api
from app.user.controller import UserInfo, Insert, Delete, Update
from app.middlewares import register_middleware_tenant_check, user_model

user_info = Blueprint('user_info', __name__, url_prefix='/user_info')
info_api = Api(user_info)

user = Blueprint('user', __name__, url_prefix='/user')
user_api = Api(user)

# 用户查询 get
info_api.add_resource(UserInfo, '/info')

# 插入用户数据 post
user_api.add_resource(Insert, '/insert')

# 用户数据删除 post
user_api.add_resource(Delete, '/delete')

# 用户数据修改 post
user_api.add_resource(Update, '/update')

user_model(user)  # 插入，删除，修改 参数提取
register_middleware_tenant_check(user_info)  # 验证token方法



